HELLO_SRCS		:= event_hello.c
HELLO_TARGET	:= $(basename $(HELLO_SRCS))
HELLO_CFLAGS	:= -Wall -Werror
HELLO_LFLAGS	:= -levent_core

EPOLL_SRCS		:= epoll_server.c
EPOLL_TARGET	:= $(basename $(EPOLL_SRCS))
EPOLL_CFLAGS	:= -Wall -Werror
EPOLL_LFLAGS	:=

EV_SRCS			:= ev_test1.c
EV_TARGET		:= $(basename $(EV_SRCS))
EV_CFLAGS		:= -Wall -Werror
EV_LFLAGS		:= -lev

TARGET	: $(HELLO_TARGET) $(EPOLL_TARGET) $(EV_TARGET)

$(HELLO_TARGET): $(HELLO_SRCS)
	$(CC) $(HELLO_CFLAGS) $(HELLO_LFLAGS) $(HELLO_SRCS) -o $@

$(EPOLL_TARGET): $(EPOLL_SRCS)
	$(CC) $(EPOLL_CFLAGS) $(EPOLL_LFLAGS) $(EPOLL_SRCS) -o $@

$(EV_TARGET): $(EV_SRCS)
	$(CC) $(EV_CFLAGS) $(EV_LFLAGS) $(EV_SRCS) -o $@

clean:
	rm -rf *.o *.swp *.bak $(HELLO_TARGET) $(EPOLL_TARGET) $(EV_TARGET)

.PHONY:
	clean $(HELLO_TARGET) $(EPOLL_TARGET) $(EV_TARGET)
